package com.example.pets.model.entities.dao;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;

import com.example.pets.model.entities.Pet;
import com.example.pets.model.entities.User;

import java.util.List;

@Dao
public interface PetDao {

    @Query("SELECT * FROM pets WHERE owner  = :owner")
    List<Pet> loadAllByIds(long owner);
    @Insert(onConflict = OnConflictStrategy.IGNORE)
    long insert(Pet pet); // 插入单个用户并返回其 row ID

    @Delete
    void delete(Pet pet);
}
